diff --git a/board/eltec/elppc/Makefile b/board/eltec/elppc/Makefile
index 1ed1a24..76b2cfe 100644
--- a/board/eltec/elppc/Makefile
+++ b/board/eltec/elppc/Makefile
@@ -30,7 +30,7 @@
 SOBJS	= asm_init.o
 
 $(LIB):	.depend $(OBJS) $(SOBJS)
-	$(AR) crv $@ $^
+	$(AR) crv $@  $(OBJS) $(SOBJS)
 
 clean:
 	rm -f $(SOBJS) $(OBJS)
@@ -46,12 +46,3 @@
 sinclude .depend
 
 #########################################################################
-
-
-
-
-
-
-
-
-
diff --git a/board/eltec/elppc/eepro100_srom.c b/board/eltec/elppc/eepro100_srom.c
index a5e47cf..9754c1d 100644
--- a/board/eltec/elppc/eepro100_srom.c
+++ b/board/eltec/elppc/eepro100_srom.c
@@ -32,7 +32,7 @@
 #include "srom.h"
 
 extern int eepro100_write_eeprom (struct eth_device* dev,
-                    int location, int addr_len, unsigned short data);
+		    int location, int addr_len, unsigned short data);
 
 /*----------------------------------------------------------------------------*/
 
@@ -43,7 +43,7 @@
 
     for (i = 0; i < (EE_SIZE-1); i++)
     {
-        sum += sromdata[i];
+	sum += sromdata[i];
     }
     return (EE_CHECKSUM - sum);
 }
@@ -57,7 +57,7 @@
 
     /* get onboard network iobase */
     pci_read_config_dword(PCI_BDF(0,0x10,0), PCI_BASE_ADDRESS_0,
-                 &onboard_dev.iobase);
+		 &onboard_dev.iobase);
     onboard_dev.iobase &= ~0xf;
 
     source[63] = eepro100_srom_checksum (source);
@@ -65,8 +65,8 @@
     for (count=0; count < EE_SIZE; count++)
     {
     if ( eepro100_write_eeprom ((struct eth_device*)&onboard_dev,
-             count, EE_ADDR_BITS, SROM_SHORT(source)) == -1 )
-        return -1;
+	     count, EE_ADDR_BITS, SROM_SHORT(source)) == -1 )
+	return -1;
     source++;
     }
     return 0;
@@ -89,22 +89,22 @@
 
     /* get onboard network iobase */
     pci_read_config_dword(PCI_BDF(0,0x10,0), PCI_BASE_ADDRESS_0,
-                 &onboard_dev.iobase);
+		 &onboard_dev.iobase);
     onboard_dev.iobase &= ~0xf;
 
     memset (destination, 0x65, 128);
 
     for (count=0; count < 0x40; count++)
     {
-        *destination++ = read_eeprom (struct eth_device*)&onboard_dev,
-                 count, EE_ADDR_BITS);
+	*destination++ = read_eeprom (struct eth_device*)&onboard_dev,
+		 count, EE_ADDR_BITS);
 #ifdef DEBUG
-        printf ("%04x ", *(destination - 1));
-        if (lr++ == 7)
-        {
-            printf("\n");
-            lr = 0;
-        }
+	printf ("%04x ", *(destination - 1));
+	if (lr++ == 7)
+	{
+	    printf("\n");
+	    lr = 0;
+	}
 #endif
     }
 }
diff --git a/board/eltec/elppc/elppc.c b/board/eltec/elppc/elppc.c
index 97b70a4..7b4d7d2 100644
--- a/board/eltec/elppc/elppc.c
+++ b/board/eltec/elppc/elppc.c
@@ -30,82 +30,81 @@
 
 int checkboard (void)
 {
-    puts ("Board: ELTEC PowerPC\n");
-    return (0);
+	puts ("Board: ELTEC PowerPC\n");
+	return (0);
 }
 
 /* ------------------------------------------------------------------------- */
 
 int checkflash (void)
 {
-    /* TODO */
-    printf ("Test not implemented !\n");
-    return (0);
+	/* TODO */
+	printf ("Test not implemented !\n");
+	return (0);
 }
 
 /* ------------------------------------------------------------------------- */
 
 static unsigned int mpc106_read_cfg_dword (unsigned int reg)
 {
-    unsigned int reg_addr = MPC106_REG | (reg & 0xFFFFFFFC);
+	unsigned int reg_addr = MPC106_REG | (reg & 0xFFFFFFFC);
 
-    out32r(MPC106_REG_ADDR, reg_addr);
+	out32r (MPC106_REG_ADDR, reg_addr);
 
-    return (in32r(MPC106_REG_DATA | (reg & 0x3)));
+	return (in32r (MPC106_REG_DATA | (reg & 0x3)));
 }
 
 /* ------------------------------------------------------------------------- */
 
 long int dram_size (int board_type)
 {
-    /*
-    * No actual initialisation to do - done when setting up
-    * PICRs MCCRs ME/SARs etc in asm_init.S.
-    */
+	/*
+	 * No actual initialisation to do - done when setting up
+	 * PICRs MCCRs ME/SARs etc in asm_init.S.
+	 */
 
-    register unsigned long i, msar1, mear1, memSize;
+	register unsigned long i, msar1, mear1, memSize;
 
 #if defined(CFG_MEMTEST)
-    register unsigned long reg;
+	register unsigned long reg;
 
-    printf("Testing DRAM\n");
+	printf ("Testing DRAM\n");
 
-    /* write each mem addr with it's address */
-    for (reg = CFG_MEMTEST_START; reg < CFG_MEMTEST_END; reg+=4)
-        *reg = reg;
+	/* write each mem addr with it's address */
+	for (reg = CFG_MEMTEST_START; reg < CFG_MEMTEST_END; reg += 4)
+		*reg = reg;
 
-    for (reg = CFG_MEMTEST_START; reg < CFG_MEMTEST_END; reg+=4)
-    {
-        if (*reg != reg)
-        return -1;
-    }
+	for (reg = CFG_MEMTEST_START; reg < CFG_MEMTEST_END; reg += 4) {
+		if (*reg != reg)
+			return -1;
+	}
 #endif
 
-    /*
-    * Since MPC107 memory controller chip has already been set to
-    * control all memory, just read and interpret its memory boundery register.
-    */
-    memSize = 0;
-    msar1 = mpc106_read_cfg_dword(MPC106_MSAR1);
-    mear1 = mpc106_read_cfg_dword(MPC106_MEAR1);
-    i     = mpc106_read_cfg_dword(MPC106_MBER) & 0xf;
+	/*
+	 * Since MPC107 memory controller chip has already been set to
+	 * control all memory, just read and interpret its memory boundery register.
+	 */
+	memSize = 0;
+	msar1 = mpc106_read_cfg_dword (MPC106_MSAR1);
+	mear1 = mpc106_read_cfg_dword (MPC106_MEAR1);
+	i = mpc106_read_cfg_dword (MPC106_MBER) & 0xf;
 
-    do
-    {
-        if (i & 0x01)   /* is bank enabled ? */
-            memSize += (mear1 & 0xff) - (msar1 & 0xff) + 1;
-        msar1 >>= 8;
-        mear1 >>= 8;
-        i     >>= 1;
-    } while (i);
+	do {
+		if (i & 0x01)			/* is bank enabled ? */
+			memSize += (mear1 & 0xff) - (msar1 & 0xff) + 1;
+		msar1 >>= 8;
+		mear1 >>= 8;
+		i >>= 1;
+	} while (i);
 
-    return (memSize * 0x100000);
+	return (memSize * 0x100000);
 }
+
 /* ------------------------------------------------------------------------- */
 
-long int initdram(int board_type)
+long int initdram (int board_type)
 {
-    return dram_size(board_type);
+	return dram_size (board_type);
 }
 
 /* ------------------------------------------------------------------------- */
@@ -115,9 +114,10 @@
  * Register PI in the MPC 107 (at offset 0x41090 of the Embedded Utilities
  * Memory Block).
  */
-void do_reset (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
+int do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
-    out8(MPC107_EUMB_PI, 1);
+	out8 (MPC107_EUMB_PI, 1);
+	return (0);
 }
 
 /* ------------------------------------------------------------------------- */
@@ -128,21 +128,21 @@
  * Since the 7xx CPUs don't have an internal watchdog, this function is
  * board specific.
  */
-void watchdog_reset(void)
+void watchdog_reset (void)
 {
 }
-#endif    /* CONFIG_WATCHDOG */
+#endif							/* CONFIG_WATCHDOG */
 
 /* ------------------------------------------------------------------------- */
 
 void after_reloc (ulong dest_addr)
 {
-    DECLARE_GLOBAL_DATA_PTR;
+	DECLARE_GLOBAL_DATA_PTR;
 
-    /*
-     * Jump to the main U-Boot board init code
-     */
-    board_init_r(gd, dest_addr);
+	/*
+	 * Jump to the main U-Boot board init code
+	 */
+	board_init_r (gd, dest_addr);
 }
 
 /* ------------------------------------------------------------------------- */
@@ -152,38 +152,23 @@
 
 void video_get_info_str (int line_number, char *info)
 {
-    /* init video info strings for graphic console */
-    switch (line_number)
-    {
-    case 1:
-        sprintf (info," MPC7xx V%d.%d at %d / %d MHz",
-            (get_pvr() >> 8) & 0xFF,
-            get_pvr() & 0xFF,
-            400,
-            100);
-        return;
-    case 2:
-        sprintf (info, " ELTEC ELPPC with %ld MB DRAM and %ld MB FLASH",
-            dram_size(0)/0x100000,
-            flash_init()/0x100000);
-        return;
-    case 3:
-        sprintf (info, " %s", smi.modeIdent);
-        return;
-    }
+	/* init video info strings for graphic console */
+	switch (line_number) {
+	case 1:
+		sprintf (info, " MPC7xx V%d.%d at %d / %d MHz",
+				 (get_pvr () >> 8) & 0xFF, get_pvr () & 0xFF, 400, 100);
+		return;
+	case 2:
+		sprintf (info, " ELTEC ELPPC with %ld MB DRAM and %ld MB FLASH",
+				 dram_size (0) / 0x100000, flash_init () / 0x100000);
+		return;
+	case 3:
+		sprintf (info, " %s", smi.modeIdent);
+		return;
+	}
 
-    /* no more info lines */
-    *info = 0;
-    return;
+	/* no more info lines */
+	*info = 0;
+	return;
 }
 #endif
-
-
-
-
-
-
-
-
-
-
diff --git a/board/eltec/elppc/flash.c b/board/eltec/elppc/flash.c
index 73496a1..442dd00 100644
--- a/board/eltec/elppc/flash.c
+++ b/board/eltec/elppc/flash.c
@@ -57,7 +57,7 @@
     /* Init: no FLASHes known */
     for (i=0; i<CFG_MAX_FLASH_BANKS; ++i)
     {
-        flash_info[i].flash_id = FLASH_UNKNOWN;
+	flash_info[i].flash_id = FLASH_UNKNOWN;
     }
 
     /* initialise 1st flash */
@@ -65,8 +65,8 @@
 
     if (flash_info[0].flash_id == FLASH_UNKNOWN)
     {
-        printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
-            size1, size1<<20);
+	printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
+	    size1, size1<<20);
     }
 
     /* initialise 2nd flash */
@@ -74,31 +74,31 @@
 
     if (flash_info[1].flash_id == FLASH_UNKNOWN)
     {
-        printf ("## Unknown FLASH on Bank 1 - Size = 0x%08lx = %ld MB\n",
-            size2, size2<<20);
+	printf ("## Unknown FLASH on Bank 1 - Size = 0x%08lx = %ld MB\n",
+	    size2, size2<<20);
     }
 
     /* monitor protection ON by default */
     if (size1 == 512*1024)
     {
-        (void)flash_protect(FLAG_PROTECT_SET,
-                FLASH_BASE0_PRELIM,
-                FLASH_BASE0_PRELIM+monitor_flash_len-1,
-                &flash_info[0]);
+	(void)flash_protect(FLAG_PROTECT_SET,
+		FLASH_BASE0_PRELIM,
+		FLASH_BASE0_PRELIM+monitor_flash_len-1,
+		&flash_info[0]);
     }
     if (size2 == 512*1024)
     {
-        (void)flash_protect(FLAG_PROTECT_SET,
-                FLASH_BASE1_PRELIM,
-                FLASH_BASE1_PRELIM+monitor_flash_len-1,
-                &flash_info[1]);
+	(void)flash_protect(FLAG_PROTECT_SET,
+		FLASH_BASE1_PRELIM,
+		FLASH_BASE1_PRELIM+monitor_flash_len-1,
+		&flash_info[1]);
     }
     if (size2 == 4*1024*1024)
     {
-        (void)flash_protect(FLAG_PROTECT_SET,
-                CFG_FLASH_BASE,
-                CFG_FLASH_BASE+monitor_flash_len-1,
-                &flash_info[1]);
+	(void)flash_protect(FLAG_PROTECT_SET,
+		CFG_FLASH_BASE,
+		CFG_FLASH_BASE+monitor_flash_len-1,
+		&flash_info[1]);
     }
 
     return (size1 + size2);
@@ -115,72 +115,72 @@
     volatile unsigned long *flash;
 
     if (info->flash_id == FLASH_UNKNOWN) {
-        printf ("missing or unknown FLASH type\n");
-        flash_init();
+	printf ("missing or unknown FLASH type\n");
+	flash_init();
     }
 
     if (info->flash_id == FLASH_UNKNOWN) {
-        printf ("missing or unknown FLASH type\n");
-        return;
+	printf ("missing or unknown FLASH type\n");
+	return;
     }
 
     switch (info->flash_id & FLASH_VENDMASK) {
     case FLASH_MAN_AMD:
-        printf ("AMD ");
-        break;
+	printf ("AMD ");
+	break;
     default:
-        printf ("Unknown Vendor ");
-        break;
+	printf ("Unknown Vendor ");
+	break;
     }
 
     switch (info->flash_id & FLASH_TYPEMASK) {
     case AMD_ID_F040B:
-        printf ("AM29F040B (4 Mbit)\n");
-        break;
+	printf ("AM29F040B (4 Mbit)\n");
+	break;
     case AMD_ID_F016D:
-        printf ("AM29F016D (16 Mbit)\n");
-        break;
+	printf ("AM29F016D (16 Mbit)\n");
+	break;
     case AMD_ID_F032B:
-        printf ("AM29F032B (32 Mbit)\n");
-        break;
+	printf ("AM29F032B (32 Mbit)\n");
+	break;
    default:
-        printf ("Unknown Chip Type\n");
-        break;
+	printf ("Unknown Chip Type\n");
+	break;
     }
 
     if (info->size >= (1 << 20)) {
-        printf ("  Size: %ld MB in %d Sectors\n", info->size >> 20, info->sector_count);
+	printf ("  Size: %ld MB in %d Sectors\n", info->size >> 20, info->sector_count);
     } else {
-        printf ("  Size: %ld kB in %d Sectors\n", info->size >> 10, info->sector_count);
+	printf ("  Size: %ld kB in %d Sectors\n", info->size >> 10, info->sector_count);
     }
 
     printf ("  Sector Start Addresses:");
     for (i=0; i<info->sector_count; ++i) {
-        /*
-        * Check if whole sector is erased
-        */
-        if (i != (info->sector_count-1))
-            size = info->start[i+1] - info->start[i];
-        else
-            size = info->start[0] + info->size - info->start[i];
+	/*
+	* Check if whole sector is erased
+	*/
+	if (i != (info->sector_count-1))
+	    size = info->start[i+1] - info->start[i];
+	else
+	    size = info->start[0] + info->size - info->start[i];
 
-        erased = 1;
-        flash = (volatile unsigned long *)info->start[i];
-        size = size >> 2;        /* divide by 4 for longword access */
-        for (k=0; k<size; k++) {
-            if (*flash++ != 0xffffffff) {
-                erased = 0;
-                break;
-            }
-        }
+	erased = 1;
+	flash = (volatile unsigned long *)info->start[i];
+	size = size >> 2;        /* divide by 4 for longword access */
+	for (k=0; k<size; k++) {
+	    if (*flash++ != 0xffffffff) {
+		erased = 0;
+		break;
+	    }
+	}
 
-        if ((i % 5) == 0)
-            printf ("\n   ");
+	if ((i % 5) == 0)
+	    printf ("\n   ");
 
-        printf (" %08lX%s%s",
-            info->start[i],
-            erased ? " E" : "  ",
-            info->protect[i] ? "RO " : "   ");
+	printf (" %08lX%s%s",
+	    info->start[i],
+	    erased ? " E" : "  ",
+	    info->protect[i] ? "RO " : "   ");
     }
     printf ("\n");
 }
@@ -226,37 +226,37 @@
     /* We accept only two AMD types */
     switch (vendor) {
     case (FLASH_WORD_SIZE)AMD_MANUFACT:
-        info->flash_id = FLASH_MAN_AMD;
-        break;
+	info->flash_id = FLASH_MAN_AMD;
+	break;
     default:
-        info->flash_id = FLASH_UNKNOWN;
-        info->sector_count = 0;
-        info->size = 0;
-        return (0);         /* no or unknown flash  */
+	info->flash_id = FLASH_UNKNOWN;
+	info->sector_count = 0;
+	info->size = 0;
+	return (0);         /* no or unknown flash  */
     }
 
     switch (devid) {
     case (FLASH_WORD_SIZE)AMD_ID_F040B:
-        info->flash_id |= AMD_ID_F040B;
-        info->sector_count = 8;
-        info->size = 0x00080000;
-        break;              /* => 0.5 MB      */
+	info->flash_id |= AMD_ID_F040B;
+	info->sector_count = 8;
+	info->size = 0x00080000;
+	break;              /* => 0.5 MB      */
 
     case (FLASH_WORD_SIZE)AMD_ID_F016D:
-        info->flash_id |= AMD_ID_F016D;
-        info->sector_count = 32;
-        info->size         = 0x00200000;
-        break;              /* => 2 MB      */
+	info->flash_id |= AMD_ID_F016D;
+	info->sector_count = 32;
+	info->size         = 0x00200000;
+	break;              /* => 2 MB      */
 
     case (FLASH_WORD_SIZE)AMD_ID_F032B:
-        info->flash_id |= AMD_ID_F032B;
-        info->sector_count = 64;
-        info->size         = 0x00400000;
-        break;              /* => 4 MB      */
+	info->flash_id |= AMD_ID_F032B;
+	info->sector_count = 64;
+	info->size         = 0x00400000;
+	break;              /* => 4 MB      */
 
     default:
-        info->flash_id = FLASH_UNKNOWN;
-        return (0);         /* => no or unknown flash */
+	info->flash_id = FLASH_UNKNOWN;
+	return (0);         /* => no or unknown flash */
 
     }
 
@@ -266,20 +266,20 @@
 
     /* check for protected sectors */
     for (i = 0; i < info->sector_count; i++) {
-        /* sector base address */
-        info->start[i] = base + i * (info->size / info->sector_count);
-        /* read sector protection at sector address, (A7 .. A0) = 0x02 */
-        /* D0 = 1 if protected */
-        caddr = (volatile unsigned char *)(info->start[i]);
-        info->protect[i] = caddr[2] & 1;
+	/* sector base address */
+	info->start[i] = base + i * (info->size / info->sector_count);
+	/* read sector protection at sector address, (A7 .. A0) = 0x02 */
+	/* D0 = 1 if protected */
+	caddr = (volatile unsigned char *)(info->start[i]);
+	info->protect[i] = caddr[2] & 1;
     }
 
     /*
      * Prevent writes to uninitialized FLASH.
      */
     if (info->flash_id != FLASH_UNKNOWN) {
-        caddr = (volatile unsigned char *)info->start[0];
-        caddr[0] = 0xF0;   /* reset bank */
+	caddr = (volatile unsigned char *)info->start[0];
+	caddr[0] = 0xF0;   /* reset bank */
     }
 
     return (info->size);
@@ -295,32 +295,32 @@
     int rc = 0;
 
     if ((s_first < 0) || (s_first > s_last)) {
-        if (info->flash_id == FLASH_UNKNOWN) {
-            printf ("- missing\n");
-        } else {
-            printf ("- no sectors to erase\n");
-        }
-        return 1;
+	if (info->flash_id == FLASH_UNKNOWN) {
+	    printf ("- missing\n");
+	} else {
+	    printf ("- no sectors to erase\n");
+	}
+	return 1;
     }
 
     if ((info->flash_id == FLASH_UNKNOWN) ||
-        (info->flash_id > FLASH_AMD_COMP)) {
-        printf ("Can't erase unknown flash type - aborted\n");
-        return 1;
+	(info->flash_id > FLASH_AMD_COMP)) {
+	printf ("Can't erase unknown flash type - aborted\n");
+	return 1;
     }
 
     prot = 0;
     for (sect=s_first; sect<=s_last; ++sect) {
-        if (info->protect[sect]) {
-            prot++;
-        }
+	if (info->protect[sect]) {
+	    prot++;
+	}
     }
 
     if (prot) {
-        printf ("- Warning: %d protected sectors will not be erased!\n",
-            prot);
+	printf ("- Warning: %d protected sectors will not be erased!\n",
+	    prot);
     } else {
-        printf ("\n");
+	printf ("\n");
     }
 
     l_sect = -1;
@@ -336,26 +336,26 @@
 
     /* Start erase on unprotected sectors */
     for (sect = s_first; sect<=s_last; sect++) {
-        if (info->protect[sect] == 0) { /* not protected */
-            addr = (FLASH_WORD_SIZE *)(info->start[sect]);
-            if (info->flash_id & FLASH_MAN_SST) {
-                addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-                addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-                addr[ADDR0] = (FLASH_WORD_SIZE)0x00800080;
-                addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-                addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-                addr[0] = (FLASH_WORD_SIZE)0x00500050;  /* block erase */
-                udelay(30000);  /* wait 30 ms */
-            }
-            else
-                addr[0] = (FLASH_WORD_SIZE)0x00300030;  /* sector erase */
-            l_sect = sect;
-        }
+	if (info->protect[sect] == 0) { /* not protected */
+	    addr = (FLASH_WORD_SIZE *)(info->start[sect]);
+	    if (info->flash_id & FLASH_MAN_SST) {
+		addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
+		addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
+		addr[ADDR0] = (FLASH_WORD_SIZE)0x00800080;
+		addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
+		addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
+		addr[0] = (FLASH_WORD_SIZE)0x00500050;  /* block erase */
+		udelay(30000);  /* wait 30 ms */
+	    }
+	    else
+		addr[0] = (FLASH_WORD_SIZE)0x00300030;  /* sector erase */
+	    l_sect = sect;
+	}
     }
 
     /* re-enable interrupts if necessary */
     if (flag)
-        enable_interrupts();
+	enable_interrupts();
 
     /* wait at least 80us - let's wait 1 ms */
     udelay (1000);
@@ -364,21 +364,21 @@
      * We wait for the last triggered sector
      */
     if (l_sect < 0)
-        goto DONE;
+	goto DONE;
 
     start = get_timer (0);
     last  = start;
     addr = (FLASH_WORD_SIZE *)(info->start[l_sect]);
     while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) {
-        if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
-            printf ("Timeout\n");
-            return 1;
-        }
-        /* show that we're waiting */
-        if ((now - last) > 1000) {  /* every second */
-            serial_putc ('.');
-            last = now;
-        }
+	if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
+	    printf ("Timeout\n");
+	    return 1;
+	}
+	/* show that we're waiting */
+	if ((now - last) > 1000) {  /* every second */
+	    serial_putc ('.');
+	    last = now;
+	}
     }
 
 DONE:
@@ -408,42 +408,42 @@
      * handle unaligned start bytes
      */
     if ((l = addr - wp) != 0) {
-        data = 0;
-        for (i=0, cp=wp; i<l; ++i, ++cp) {
-            data = (data << 8) | (*(uchar *)cp);
-        }
-        for (; i<4 && cnt>0; ++i) {
-            data = (data << 8) | *src++;
-            --cnt;
-            ++cp;
-        }
-        for (; cnt==0 && i<4; ++i, ++cp) {
-            data = (data << 8) | (*(uchar *)cp);
-        }
+	data = 0;
+	for (i=0, cp=wp; i<l; ++i, ++cp) {
+	    data = (data << 8) | (*(uchar *)cp);
+	}
+	for (; i<4 && cnt>0; ++i) {
+	    data = (data << 8) | *src++;
+	    --cnt;
+	    ++cp;
+	}
+	for (; cnt==0 && i<4; ++i, ++cp) {
+	    data = (data << 8) | (*(uchar *)cp);
+	}
 
-        if ((rc = write_word(info, wp, data)) != 0) {
-            return (rc);
-        }
-        wp += 4;
+	if ((rc = write_word(info, wp, data)) != 0) {
+	    return (rc);
+	}
+	wp += 4;
     }
 
     /*
      * handle word aligned part
      */
     while (cnt >= 4) {
-        data = 0;
-        for (i=0; i<4; ++i) {
-            data = (data << 8) | *src++;
-        }
-        if ((rc = write_word(info, wp, data)) != 0) {
-            return (rc);
-        }
-        wp  += 4;
-        cnt -= 4;
+	data = 0;
+	for (i=0; i<4; ++i) {
+	    data = (data << 8) | *src++;
+	}
+	if ((rc = write_word(info, wp, data)) != 0) {
+	    return (rc);
+	}
+	wp  += 4;
+	cnt -= 4;
     }
 
     if (cnt == 0) {
-        return (0);
+	return (0);
     }
 
     /*
@@ -451,11 +451,11 @@
      */
     data = 0;
     for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) {
-        data = (data << 8) | *src++;
-        --cnt;
+	data = (data << 8) | *src++;
+	--cnt;
     }
     for (; i<4; ++i, ++cp) {
-        data = (data << 8) | (*(uchar *)cp);
+	data = (data << 8) | (*(uchar *)cp);
     }
 
     return (write_word(info, wp, data));
@@ -469,45 +469,44 @@
  */
 static int write_word (flash_info_t *info, ulong dest, ulong data)
 {
-        volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)(info->start[0]);
-        volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *)dest;
-        volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *)&data;
+	volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)(info->start[0]);
+	volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *)dest;
+	volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *)&data;
     ulong start;
     int flag;
-        int i;
+	int i;
 
     /* Check if Flash is (sufficiently) erased */
     if ((*((volatile FLASH_WORD_SIZE *)dest) &
-             (FLASH_WORD_SIZE)data) != (FLASH_WORD_SIZE)data) {
-        return (2);
+	     (FLASH_WORD_SIZE)data) != (FLASH_WORD_SIZE)data) {
+	return (2);
     }
     /* Disable interrupts which might cause a timeout here */
     flag = disable_interrupts();
 
-        for (i=0; i<4/sizeof(FLASH_WORD_SIZE); i++)
-          {
-            addr2[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-            addr2[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-            addr2[ADDR0] = (FLASH_WORD_SIZE)0x00A000A0;
+	for (i=0; i<4/sizeof(FLASH_WORD_SIZE); i++)
+	  {
+	    addr2[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
+	    addr2[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
+	    addr2[ADDR0] = (FLASH_WORD_SIZE)0x00A000A0;
 
-            dest2[i] = data2[i];
+	    dest2[i] = data2[i];
 
-            /* re-enable interrupts if necessary */
-            if (flag)
-              enable_interrupts();
+	    /* re-enable interrupts if necessary */
+	    if (flag)
+	      enable_interrupts();
 
-            /* data polling for D7 */
-            start = get_timer (0);
-            while ((dest2[i] & (FLASH_WORD_SIZE)0x00800080) !=
-                   (data2[i] & (FLASH_WORD_SIZE)0x00800080)) {
-              if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
-                return (1);
-              }
-            }
-          }
+	    /* data polling for D7 */
+	    start = get_timer (0);
+	    while ((dest2[i] & (FLASH_WORD_SIZE)0x00800080) !=
+		   (data2[i] & (FLASH_WORD_SIZE)0x00800080)) {
+	      if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
+		return (1);
+	      }
+	    }
+	  }
 
     return (0);
 }
 
 /*----------------------------------------------------------------------------*/
-
diff --git a/board/eltec/elppc/misc.c b/board/eltec/elppc/misc.c
index 7bfb3a4..f33aef7 100644
--- a/board/eltec/elppc/misc.c
+++ b/board/eltec/elppc/misc.c
@@ -32,7 +32,7 @@
 extern char console_buffer[CFG_CBSIZE];
 extern int l2_cache_enable (int l2control);
 extern int eepro100_write_eeprom (struct eth_device* dev, int location,
-                 int addr_len, unsigned short data);
+		 int addr_len, unsigned short data);
 extern int read_eeprom (struct eth_device* dev, int location, int addr_len);
 
 /*----------------------------------------------------------------------------*/
@@ -45,7 +45,7 @@
     uchar *s = (uchar *) (CFG_ENV_MAP_ADRS + src);
 
     while (count--)
-        *d++ = *s++;
+	*d++ = *s++;
 
     return dest;
 }
@@ -56,7 +56,7 @@
     uchar *s = (uchar *) src;
 
     while (count--)
-        *d++ = *s++;
+	*d++ = *s++;
 }
 
 /*----------------------------------------------------------------------------*/
@@ -72,7 +72,7 @@
     u_int  i, l, initSrom, copyNv;
     char buf[256];
     char hex[23] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0,
-                     0, 0, 0, 0, 10, 11, 12, 13, 14, 15 };
+		     0, 0, 0, 0, 10, 11, 12, 13, 14, 15 };
 
     /* Clock setting for MPC107 i2c */
     mpc107_i2c_init (MPC107_EUMB_ADDR, 0x2b);
@@ -91,166 +91,166 @@
 
     /* read out current revision srom contens */
     mpc107_srom_load (0x0000, (u_char*)&eerev, sizeof(revinfo),
-                SECOND_DEVICE, FIRST_BLOCK);
+		SECOND_DEVICE, FIRST_BLOCK);
 
     /* read out current nvram shadow image */
     nvram_read (buf, CFG_NV_SROM_COPY_ADDR, CFG_SROM_SIZE);
 
     if (strcmp (eerev.magic, "ELTEC") != 0)
     {
-        /* srom is not initialized -> create a default revision info */
-        for (i = 0, ptr = (u_char *)&eerev; i < sizeof(revinfo); i++)
-            *ptr++ = 0x00;
-        strcpy(eerev.magic, "ELTEC");
-        eerev.revrev[0] = 1;
-        eerev.revrev[1] = 0;
-        eerev.size = 0x00E0;
-        eerev.category[0] = 0x01;
+	/* srom is not initialized -> create a default revision info */
+	for (i = 0, ptr = (u_char *)&eerev; i < sizeof(revinfo); i++)
+	    *ptr++ = 0x00;
+	strcpy(eerev.magic, "ELTEC");
+	eerev.revrev[0] = 1;
+	eerev.revrev[1] = 0;
+	eerev.size = 0x00E0;
+	eerev.category[0] = 0x01;
 
-        /* node id from dead e128 as default */
-        eerev.etheraddr[0] = 0x00;
-        eerev.etheraddr[1] = 0x00;
-        eerev.etheraddr[2] = 0x5B;
-        eerev.etheraddr[3] = 0x00;
-        eerev.etheraddr[4] = 0x2E;
-        eerev.etheraddr[5] = 0x4D;
+	/* node id from dead e128 as default */
+	eerev.etheraddr[0] = 0x00;
+	eerev.etheraddr[1] = 0x00;
+	eerev.etheraddr[2] = 0x5B;
+	eerev.etheraddr[3] = 0x00;
+	eerev.etheraddr[4] = 0x2E;
+	eerev.etheraddr[5] = 0x4D;
 
-        /* cache config word for ELPPC */
-        *(int*)&eerev.res[0] = 0;
+	/* cache config word for ELPPC */
+	*(int*)&eerev.res[0] = 0;
 
-        initSrom = 1;  /* force dialog */
-        copyNv   = 1;  /* copy to nvram */
+	initSrom = 1;  /* force dialog */
+	copyNv   = 1;  /* copy to nvram */
     }
 
     if ((copyNv == 0) &&   (el_srom_checksum((u_char*)&eerev, CFG_SROM_SIZE) !=
-                el_srom_checksum((u_char*)buf, CFG_SROM_SIZE)))
+		el_srom_checksum((u_char*)buf, CFG_SROM_SIZE)))
     {
-        printf ("Invalid revision info copy in nvram !\n");
-        printf ("Press key:\n  <c> to copy current revision info to nvram.\n");
-        printf ("  <r> to reenter revision info.\n");
-        printf ("=> ");
-        if (0 != readline (NULL))
-        {
-            switch ((char)toupper(console_buffer[0]))
-            {
-            case 'C':
-                copyNv = 1;
-                break;
-            case 'R':
-                copyNv = 1;
-                initSrom = 1;
-                break;
-            }
-        }
+	printf ("Invalid revision info copy in nvram !\n");
+	printf ("Press key:\n  <c> to copy current revision info to nvram.\n");
+	printf ("  <r> to reenter revision info.\n");
+	printf ("=> ");
+	if (0 != readline (NULL))
+	{
+	    switch ((char)toupper(console_buffer[0]))
+	    {
+	    case 'C':
+		copyNv = 1;
+		break;
+	    case 'R':
+		copyNv = 1;
+		initSrom = 1;
+		break;
+	    }
+	}
     }
 
     if (initSrom)
     {
-        memcpy (buf, &eerev.revision[0][0], 14);     /* save all revision info */
-        printf ("Enter revision number (0-9): %c  ", eerev.revision[0][0]);
-        if (0 != readline (NULL))
-        {
-            eerev.revision[0][0] = (char)toupper(console_buffer[0]);
-            memcpy (&eerev.revision[1][0], buf, 12); /* shift rest of rev info */
-        }
+	memcpy (buf, &eerev.revision[0][0], 14);     /* save all revision info */
+	printf ("Enter revision number (0-9): %c  ", eerev.revision[0][0]);
+	if (0 != readline (NULL))
+	{
+	    eerev.revision[0][0] = (char)toupper(console_buffer[0]);
+	    memcpy (&eerev.revision[1][0], buf, 12); /* shift rest of rev info */
+	}
 
-        printf ("Enter revision character (A-Z): %c  ", eerev.revision[0][1]);
-        if (1 == readline (NULL))
-        {
-            eerev.revision[0][1] = (char)toupper(console_buffer[0]);
-        }
+	printf ("Enter revision character (A-Z): %c  ", eerev.revision[0][1]);
+	if (1 == readline (NULL))
+	{
+	    eerev.revision[0][1] = (char)toupper(console_buffer[0]);
+	}
 
-        printf ("Enter board name (V-XXXX-XXXX): %s  ", (char *)&eerev.board);
-        if (11 == readline (NULL))
-        {
-            for (i=0; i<11; i++)
-                eerev.board[i] =  (char)toupper(console_buffer[i]);
-            eerev.board[11] = '\0';
-        }
+	printf ("Enter board name (V-XXXX-XXXX): %s  ", (char *)&eerev.board);
+	if (11 == readline (NULL))
+	{
+	    for (i=0; i<11; i++)
+		eerev.board[i] =  (char)toupper(console_buffer[i]);
+	    eerev.board[11] = '\0';
+	}
 
-        printf ("Enter serial number: %s ", (char *)&eerev.serial );
-        if (6 == readline (NULL))
-        {
-            for (i=0; i<6; i++)
-                eerev.serial[i] = console_buffer[i];
-            eerev.serial[6] = '\0';
-        }
+	printf ("Enter serial number: %s ", (char *)&eerev.serial );
+	if (6 == readline (NULL))
+	{
+	    for (i=0; i<6; i++)
+		eerev.serial[i] = console_buffer[i];
+	    eerev.serial[6] = '\0';
+	}
 
-        printf ("Enter ether node ID with leading zero (HEX): %02x%02x%02x%02x%02x%02x  ",
-            eerev.etheraddr[0], eerev.etheraddr[1],
-            eerev.etheraddr[2], eerev.etheraddr[3],
-            eerev.etheraddr[4], eerev.etheraddr[5]);
-        if (12 == readline (NULL))
-        {
-            for (i=0; i<12; i+=2)
-            eerev.etheraddr[i>>1] = (char)(16*hex[toupper(console_buffer[i])-'0'] +
-                               hex[toupper(console_buffer[i+1])-'0']);
-        }
+	printf ("Enter ether node ID with leading zero (HEX): %02x%02x%02x%02x%02x%02x  ",
+	    eerev.etheraddr[0], eerev.etheraddr[1],
+	    eerev.etheraddr[2], eerev.etheraddr[3],
+	    eerev.etheraddr[4], eerev.etheraddr[5]);
+	if (12 == readline (NULL))
+	{
+	    for (i=0; i<12; i+=2)
+	    eerev.etheraddr[i>>1] = (char)(16*hex[toupper(console_buffer[i])-'0'] +
+			       hex[toupper(console_buffer[i+1])-'0']);
+	}
 
-        l = strlen ((char *)&eerev.text);
-        printf("Add to text section (max 64 chr): %s ", (char *)&eerev.text );
-        if (0 != readline (NULL))
-        {
-            for (i = l; i<63; i++)
-                eerev.text[i] = console_buffer[i-l];
-            eerev.text[63] = '\0';
-        }
+	l = strlen ((char *)&eerev.text);
+	printf("Add to text section (max 64 chr): %s ", (char *)&eerev.text );
+	if (0 != readline (NULL))
+	{
+	    for (i = l; i<63; i++)
+		eerev.text[i] = console_buffer[i-l];
+	    eerev.text[63] = '\0';
+	}
 
-        /* prepare network eeprom */
-        memset (buf, 0, 128);
+	/* prepare network eeprom */
+	memset (buf, 0, 128);
 
-        buf[0] = eerev.etheraddr[1];
-        buf[1] = eerev.etheraddr[0];
-        buf[2] = eerev.etheraddr[3];
-        buf[3] = eerev.etheraddr[2];
-        buf[4] = eerev.etheraddr[5];
-        buf[5] = eerev.etheraddr[4];
+	buf[0] = eerev.etheraddr[1];
+	buf[1] = eerev.etheraddr[0];
+	buf[2] = eerev.etheraddr[3];
+	buf[3] = eerev.etheraddr[2];
+	buf[4] = eerev.etheraddr[5];
+	buf[5] = eerev.etheraddr[4];
 
-        *(unsigned short *)&buf[20] = 0x48B2;
-        *(unsigned short *)&buf[22] = 0x0004;
-        *(unsigned short *)&buf[24] = 0x1433;
+	*(unsigned short *)&buf[20] = 0x48B2;
+	*(unsigned short *)&buf[22] = 0x0004;
+	*(unsigned short *)&buf[24] = 0x1433;
 
-        printf("\nSRom:  Writing i82559 info ........ ");
-        if (eepro100_srom_store ((unsigned short *)buf) == -1)
-            printf("FAILED\n");
-        else
-            printf("OK\n");
+	printf("\nSRom:  Writing i82559 info ........ ");
+	if (eepro100_srom_store ((unsigned short *)buf) == -1)
+	    printf("FAILED\n");
+	else
+	    printf("OK\n");
 
-        /* update CRC */
-        eerev.crc = el_srom_checksum((u_char *)eerev.board, eerev.size);
+	/* update CRC */
+	eerev.crc = el_srom_checksum((u_char *)eerev.board, eerev.size);
 
-        /* write new values */
-        printf("\nSRom:  Writing revision info ...... ");
-        if (mpc107_srom_store((BLOCK_SIZE-sizeof(revinfo)), (u_char *)&eerev,
-                            sizeof(revinfo), SECOND_DEVICE, FIRST_BLOCK) == -1)
-            printf("FAILED\n\n");
-        else
-            printf("OK\n\n");
+	/* write new values */
+	printf("\nSRom:  Writing revision info ...... ");
+	if (mpc107_srom_store((BLOCK_SIZE-sizeof(revinfo)), (u_char *)&eerev,
+			    sizeof(revinfo), SECOND_DEVICE, FIRST_BLOCK) == -1)
+	    printf("FAILED\n\n");
+	else
+	    printf("OK\n\n");
 
-        /* write new values as shadow image to nvram */
-        nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
+	/* write new values as shadow image to nvram */
+	nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
 
     } /*if (initSrom) */
 
     /* copy current values as shadow image to nvram */
     if (initSrom == 0 && copyNv == 1)
-        nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
+	nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
 
     /* update environment */
     sprintf (buf, "%02x:%02x:%02x:%02x:%02x:%02x",
-            eerev.etheraddr[0], eerev.etheraddr[1],
-            eerev.etheraddr[2], eerev.etheraddr[3],
-            eerev.etheraddr[4], eerev.etheraddr[5]);
+	    eerev.etheraddr[0], eerev.etheraddr[1],
+	    eerev.etheraddr[2], eerev.etheraddr[3],
+	    eerev.etheraddr[4], eerev.etheraddr[5]);
     setenv ("ethaddr", buf);
 
     /* set serial console as default */
     if ((ptr = getenv ("console")) == NULL)
-        setenv ("console", "serial");
+	setenv ("console", "serial");
 
     /* print actual board identification */
     printf("Ident: %s  Ser %s  Rev %c%c\n",
-            eerev.board, (char *)&eerev.serial,
-            eerev.revision[0][0], eerev.revision[0][1]);
+	    eerev.board, (char *)&eerev.serial,
+	    eerev.revision[0][0], eerev.revision[0][1]);
 
     return (0);
 }
diff --git a/board/eltec/elppc/mpc107_i2c.c b/board/eltec/elppc/mpc107_i2c.c
index a4bf599..ae6642e 100644
--- a/board/eltec/elppc/mpc107_i2c.c
+++ b/board/eltec/elppc/mpc107_i2c.c
@@ -43,13 +43,13 @@
 
     for (; size; size--)
     {
-        byte = *ptr++;
-        for (i = 8; i; i--)
-        {
-            f =  ((byte & 1) ^ (accu & 1)) ? 0x84083001 : 0;
-            accu >>= 1; accu ^= f;
-            byte >>= 1;
-        }
+	byte = *ptr++;
+	for (i = 8; i; i--)
+	{
+	    f =  ((byte & 1) ^ (accu & 1)) ? 0x84083001 : 0;
+	    accu >>= 1; accu ^= f;
+	    byte >>= 1;
+	}
     }
     return(accu);
 }
@@ -62,13 +62,13 @@
 
     while (((x = in32r(MPC107_I2CSR)) & 0x82) != 0x82)
     {
-        if (!timeout--)
-            return -1;
+	if (!timeout--)
+	    return -1;
     }
 
     if (x & 0x10)
     {
-        return -1;
+	return -1;
     }
     out32r(MPC107_I2CSR, 0);
 
@@ -81,8 +81,8 @@
 {
     while (in32r(MPC107_I2CSR) & 0x20)
     {
-        if (!timeout--)
-            return -1;
+	if (!timeout--)
+	    return -1;
     }
     return 0;
 }
@@ -99,7 +99,7 @@
     int data;
 
     if (!mpc107_eumb_addr)
-        return -6;
+	return -6;
 
     mpc107_i2c_wait_idle (timeout);
 
@@ -112,15 +112,15 @@
 
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_read Error 1\n");
-        return -2;
+	printf("mpc107_i2c_read Error 1\n");
+	return -2;
     }
 
     if (in32r(MPC107_I2CSR)&0x1)
     {
-        /* Generate STOP condition; device busy or not existing */
-        out32r(MPC107_I2CCR, 0x80);
-        return -1;
+	/* Generate STOP condition; device busy or not existing */
+	out32r(MPC107_I2CCR, 0x80);
+	return -1;
     }
 
     /* Data address */
@@ -128,8 +128,8 @@
 
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_read Error 2\n");
-        return -3;
+	printf("mpc107_i2c_read Error 2\n");
+	return -3;
     }
 
     /* Switch to read - restart */
@@ -138,8 +138,8 @@
 
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_read Error 3\n");
-        return -4;
+	printf("mpc107_i2c_read Error 3\n");
+	return -4;
     }
 
     out32r(MPC107_I2CCR, 0xA8); /* no ACK */
@@ -147,8 +147,8 @@
 
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_read Error 4\n");
-        return -5;
+	printf("mpc107_i2c_read Error 4\n");
+	return -5;
     }
     /* Generate STOP condition */
     out32r(MPC107_I2CCR, 0x88);
@@ -171,7 +171,7 @@
     unsigned long timeout = MPC107_I2C_TIMEOUT;
 
     if (!mpc107_eumb_addr)
-        return -6;
+	return -6;
 
     mpc107_i2c_wait_idle(timeout);
 
@@ -184,8 +184,8 @@
 
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_write Error 1\n");
-        return -1;
+	printf("mpc107_i2c_write Error 1\n");
+	return -1;
     }
 
     /* Data address */
@@ -193,16 +193,16 @@
 
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_write Error 2\n");
-        return -1;
+	printf("mpc107_i2c_write Error 2\n");
+	return -1;
     }
 
     /* Write */
     out32r(MPC107_I2CDR, val);
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_write Error 3\n");
-        return -1;
+	printf("mpc107_i2c_write Error 3\n");
+	return -1;
     }
 
     /* Generate Stop Condition */
@@ -227,38 +227,38 @@
 
     for (i = 0; i < cnt; i++)
     {
-        timeout=100;
-        do
-        {
-            val = mpc107_i2c_read_byte (device, block, addr);
-            if (val < -1)
-            {
-            printf("i2c_read_error %d at dev %x block %x addr %x\n",
-                   val, device, block, addr);
-            return -1;
-            }
-            else if (timeout==0)
-            {
-                printf ("i2c_read_error: timeout at dev %x block %x addr %x\n",
-                        device, block, addr);
-                return -1;
-            }
-            timeout--;
-        } while (val == -1); /* if no ack: try again! */
+	timeout=100;
+	do
+	{
+	    val = mpc107_i2c_read_byte (device, block, addr);
+	    if (val < -1)
+	    {
+	    printf("i2c_read_error %d at dev %x block %x addr %x\n",
+		   val, device, block, addr);
+	    return -1;
+	    }
+	    else if (timeout==0)
+	    {
+		printf ("i2c_read_error: timeout at dev %x block %x addr %x\n",
+			device, block, addr);
+		return -1;
+	    }
+	    timeout--;
+	} while (val == -1); /* if no ack: try again! */
 
-        *pBuf++ = (unsigned char)val;
-        addr++;
+	*pBuf++ = (unsigned char)val;
+	addr++;
 
-        if ((addr == 0) && (i != cnt-1))    /* is it the same block ? */
-        {
-            if (block == FIRST_BLOCK)
-                block = SECOND_BLOCK;
-            else
-            {
-                printf ("ic2_read_error: read beyond 2. block !\n");
-                return -1;
-            }
-        }
+	if ((addr == 0) && (i != cnt-1))    /* is it the same block ? */
+	{
+	    if (block == FIRST_BLOCK)
+		block = SECOND_BLOCK;
+	    else
+	    {
+		printf ("ic2_read_error: read beyond 2. block !\n");
+		return -1;
+	    }
+	}
     }
     udelay(100000);
     return (cnt);
@@ -277,20 +277,20 @@
 
     for (i = 0; i < cnt; i++)
     {
-        while (mpc107_i2c_write_byte (device,block,addr,*pBuf) == 1);
-        addr++;
-        pBuf++;
+	while (mpc107_i2c_write_byte (device,block,addr,*pBuf) == 1);
+	addr++;
+	pBuf++;
 
-        if ((addr == 0) && (i != cnt-1))     /* is it the same block ? */
-        {
-            if (block == FIRST_BLOCK)
-                block = SECOND_BLOCK;
-            else
-            {
-                printf ("ic2_write_error: write beyond 2. block !\n");
-                return -1;
-            }
-        }
+	if ((addr == 0) && (i != cnt-1))     /* is it the same block ? */
+	{
+	    if (block == FIRST_BLOCK)
+		block = SECOND_BLOCK;
+	    else
+	    {
+		printf ("ic2_write_error: write beyond 2. block !\n");
+		return -1;
+	    }
+	}
     }
     udelay(100000);
     return(cnt);
@@ -303,9 +303,9 @@
     unsigned long x;
 
     if (eumb_addr)
-        mpc107_eumb_addr = eumb_addr;
+	mpc107_eumb_addr = eumb_addr;
     else
-        return -1;
+	return -1;
 
     /* Set I2C clock */
     x = in32r(MPC107_I2CFDR) & 0xffffff00;
diff --git a/board/eltec/elppc/pci.c b/board/eltec/elppc/pci.c
index 2bbb5f2..5b115ea 100644
--- a/board/eltec/elppc/pci.c
+++ b/board/eltec/elppc/pci.c
@@ -42,44 +42,44 @@
     hose->last_busno = 0xff;
 
     pci_set_region(hose->regions + 0,
-        CFG_PCI_MEMORY_BUS,
-        CFG_PCI_MEMORY_PHYS,
-        CFG_PCI_MEMORY_SIZE,
-        PCI_REGION_MEM | PCI_REGION_MEMORY);
+	CFG_PCI_MEMORY_BUS,
+	CFG_PCI_MEMORY_PHYS,
+	CFG_PCI_MEMORY_SIZE,
+	PCI_REGION_MEM | PCI_REGION_MEMORY);
 
     /* PCI memory space */
     pci_set_region(hose->regions + 1,
-        CFG_PCI_MEM_BUS,
-        CFG_PCI_MEM_PHYS,
-        CFG_PCI_MEM_SIZE,
-        PCI_REGION_MEM);
+	CFG_PCI_MEM_BUS,
+	CFG_PCI_MEM_PHYS,
+	CFG_PCI_MEM_SIZE,
+	PCI_REGION_MEM);
 
     /* ISA/PCI memory space */
     pci_set_region(hose->regions + 2,
-        CFG_ISA_MEM_BUS,
-        CFG_ISA_MEM_PHYS,
-        CFG_ISA_MEM_SIZE,
-        PCI_REGION_MEM);
+	CFG_ISA_MEM_BUS,
+	CFG_ISA_MEM_PHYS,
+	CFG_ISA_MEM_SIZE,
+	PCI_REGION_MEM);
 
     /* PCI I/O space */
     pci_set_region(hose->regions + 3,
-        CFG_PCI_IO_BUS,
-        CFG_PCI_IO_PHYS,
-        CFG_PCI_IO_SIZE,
-        PCI_REGION_IO);
+	CFG_PCI_IO_BUS,
+	CFG_PCI_IO_PHYS,
+	CFG_PCI_IO_SIZE,
+	PCI_REGION_IO);
 
     /* ISA/PCI I/O space */
     pci_set_region(hose->regions + 4,
-        CFG_ISA_IO_BUS,
-        CFG_ISA_IO_PHYS,
-        CFG_ISA_IO_SIZE,
-        PCI_REGION_IO);
+	CFG_ISA_IO_BUS,
+	CFG_ISA_IO_PHYS,
+	CFG_ISA_IO_SIZE,
+	PCI_REGION_IO);
 
     hose->region_count = 5;
 
     pci_setup_indirect(hose,
-        MPC106_REG_ADDR,
-        MPC106_REG_DATA);
+	MPC106_REG_ADDR,
+	MPC106_REG_DATA);
 
     pci_register_hose(hose);
 
diff --git a/board/eltec/elppc/srom.h b/board/eltec/elppc/srom.h
index 7924bcd..c18ab91 100644
--- a/board/eltec/elppc/srom.h
+++ b/board/eltec/elppc/srom.h
@@ -81,18 +81,18 @@
 
 unsigned long el_srom_checksum (unsigned char *ptr, unsigned long size);
 int el_srom_load  (unsigned char addr, unsigned char *buf, int cnt,
-                   unsigned char device, unsigned char block);
+		   unsigned char device, unsigned char block);
 int el_srom_store (unsigned char addr, unsigned char *buf, int cnt,
-                   unsigned char device, unsigned char block);
+		   unsigned char device, unsigned char block);
 
 int mpc107_i2c_init (unsigned long eumb_addr, unsigned long divider);
 int mpc107_i2c_read_byte (unsigned char device, unsigned char block, unsigned char offset);
 int mpc107_i2c_write_byte (unsigned char device, unsigned char block,
-                           unsigned char offset, unsigned char val);
+			   unsigned char offset, unsigned char val);
 int mpc107_srom_load (unsigned char addr, unsigned char *pBuf, int cnt,
-                      unsigned char device, unsigned char block);
+		      unsigned char device, unsigned char block);
 int mpc107_srom_store (unsigned char addr, unsigned char *pBuf, int cnt,
-                       unsigned char device, unsigned char block);
+		       unsigned char device, unsigned char block);
 
 int dc_srom_load (unsigned short *dest);
 int dc_srom_store (unsigned short *src);
diff --git a/board/eltec/elppc/u-boot.lds b/board/eltec/elppc/u-boot.lds
index de50bf4..0dfa8c0 100644
--- a/board/eltec/elppc/u-boot.lds
+++ b/board/eltec/elppc/u-boot.lds
@@ -106,6 +106,11 @@
   _edata  =  .;
   PROVIDE (edata = .);
 
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
   __start___ex_table = .;
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;
